package com.tarzan.system.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.tarzan.system.dao.GatewayRouteMapper;
import com.tarzan.system.entity.GatewayRoutes;
import com.tarzan.system.service.GatewayRouteService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Package com.tarzan.gateway.service.impl
 * @Title GatewayRouteServiceImpl
 * @Description TODO
 * @Author liujinshan
 * @CreateTime 2021/8/3 14:36
 */

@Service
public class GatewayRouteServiceImpl extends ServiceImpl<GatewayRouteMapper,GatewayRoutes> implements GatewayRouteService {

    @Autowired
    private GatewayRouteMapper gatewayRouteMapper;

    /**
     * @return java.util.List<com.tarzan.gateway.model.GatewayRoutes>
     * @title findAll
     * @description TODO
     * @author liujinshan
     * @data 2021/8/3 14:40
     */
    @Override
    public List<GatewayRoutes> findAll() {
        QueryWrapper<GatewayRoutes> queryWrapper = new QueryWrapper<>();
        return gatewayRouteMapper.selectList(queryWrapper);
    }

    /**
     * @param gatewayRoutes
     * @return void
     * @title save
     * @description TODO
     * @author liujinshan
     * @data 2021/8/3 14:40
     */
    @Override
    public void insert(GatewayRoutes gatewayRoutes) {
        gatewayRouteMapper.insert(gatewayRoutes);
    }

    /**
     * @param gatewayRoutes
     * @return void
     * @title update
     * @description TODO
     * @author liujinshan
     * @data 2021/8/3 14:40
     */
    @Override
    public void update(GatewayRoutes gatewayRoutes) {
        gatewayRouteMapper.updateById(gatewayRoutes);
    }

    /**
     * @param id
     * @return void
     * @title del
     * @description TODO
     * @author liujinshan
     * @data 2021/8/3 15:40
     */
    @Override
    public void del(Long id) {
        gatewayRouteMapper.deleteById(id);
    }
}
